package cn.xspace.library.bean;

import android.text.TextUtils;

import com.xspace.android.xafcommon.util.Constants;

/**
 * Wubj 创建于 2016/12/27 0027.
 */
public class Type {

    public interface GroupType {
        int NORMAL = 0; //普通群组
        int TEMP_GROUP = 1; //临时会话
        int PROFESSIONAL = 2; //专业群组
        int ORGANIZATION = 3; //机构群组
        int QAC = 4; //在线农技员

        int MANAGER = 9; //群组助手条目专用
    }

    //收藏的来源类型
    public interface collectionFromType {
        String FROM_NOTOCE = "通知公告";
        String FROM_WNX = "微农信";
        String FROM_HOME = "资讯栏目";
    }

    //收藏的类型0图片 1语音 2 视频 3文本 4其它 5 附件（文件）6 系统提示 7位置 8 文章
    public interface CollectionType {
        int PIC = 0;
        int VOICE = 1;
        int VIDEO = 2;
        int TEXT = 3;
        int OTHER = 4;
        int DOCUMENT = 5;
        int WARNIMG = 6;
        int LOCATION = 7;
        int ARTICAL = 8;
    }

    //工作事项的执行状态
    public interface WorkItemOperateStatus {
        int ALL = -1;
        //未执行
        int UN_OPERATE = 0;
        //已驳回
        int CANCEL = 1;
        //未指派
        int UN_POINT = 2;
        //已执行
        int COMPLETE = 3;
        //已延期
        int OUT_TIME = 4;
        //已停用
        int STOP = 5;
    }

    public static int getWorkItemServStatusByLocal(int local) {
        switch (local) {
            case WorkItemOperateStatus.UN_OPERATE:
                return 0;
            case WorkItemOperateStatus.COMPLETE:
                return 1;
            case WorkItemOperateStatus.STOP:
                return 2;
            default:
                return -1;
        }
    }

    public static int getApplyFormServStatusByLocal(int local) {
        switch (local) {
            case WorkItemOperateStatus.UN_POINT:
                return 0;
            case WorkItemOperateStatus.UN_OPERATE:
                return 1;
            case WorkItemOperateStatus.COMPLETE:
                return 2;
            case WorkItemOperateStatus.CANCEL:
                return 3;
            default:
                return -1;
        }
    }

    public static String getWorkItemDesStatus(int workStatus) {
        if (WorkItemOperateStatus.UN_OPERATE == workStatus) {
            return "未执行";
        } else if (WorkItemOperateStatus.UN_POINT == workStatus) {
            return "未指派";
        } else if (WorkItemOperateStatus.CANCEL == workStatus) {
            return "已驳回";
        } else if (WorkItemOperateStatus.COMPLETE == workStatus) {
            return "已执行";
        } else if (WorkItemOperateStatus.OUT_TIME == workStatus) {
            return "已延期";
        } else if (WorkItemOperateStatus.STOP == workStatus) {
            return "已停用";
        } else if (WorkItemOperateStatus.ALL == workStatus) {
            return "全部";
        }
        return "未执行";
    }

    /**
     * 解析服务端传来的申报单状态
     *
     * @param workStatus
     * @return
     */
    public static int getApplyFormStatusServer(String workStatus) {
        if (TextUtils.equals("0", workStatus)) {
            return WorkItemOperateStatus.UN_POINT;
        } else if (TextUtils.equals("1", workStatus)) {
            return WorkItemOperateStatus.UN_OPERATE;
        } else if (TextUtils.equals("2", workStatus)) {
            return WorkItemOperateStatus.COMPLETE;
        } else if (TextUtils.equals("3", workStatus)) {
            return WorkItemOperateStatus.CANCEL;
        }
        return Type.WorkItemOperateStatus.UN_POINT;
    }

    /**
     * 解析服务端传来的工作事项状态
     *
     * @param workStatus
     * @return
     */
    public static int getWorkItemStatusServer(String workStatus) {
        if (TextUtils.equals("0", workStatus)) {
            return Type.WorkItemOperateStatus.UN_OPERATE;
        } else if (TextUtils.equals("1", workStatus)) {
            return WorkItemOperateStatus.COMPLETE;
        } else if (TextUtils.equals("2", workStatus)) {
            return WorkItemOperateStatus.OUT_TIME;
        } else if (TextUtils.equals("3", workStatus)) {
            return WorkItemOperateStatus.STOP;
        }
        return Type.WorkItemOperateStatus.UN_OPERATE;
    }

    public enum EditType {
        GroupNameEdit(0, "群聊名称", Constants.UPDATE_USER_GROUP, 16.0f),

        WorkItemRemark(1, "备注", Constants.UPDATE_WORKDETAIL_REMARK, 99.0f);

        int number = 0;
        String showName = "";
        String url = "";
        float maxNum = 0.0f;

        public int getNumber() {
            return number;
        }

        public float getMaxNum() {
            return maxNum;
        }

        public String getShowName() {
            return showName;
        }

        public String getUrl() {
            return url;
        }

        EditType(int number, String showName, String url, float maxNum) {
            this.number = number;
            this.showName = showName;
            this.url = url;
            this.maxNum = maxNum;
        }
    }

    /**
     * 0 工作记录列表
     * 1 申报工作
     * 2 周期性工作
     * 3 固定工作
     */
    public interface WorkType {
        int MYWORK_RECORD = 0; //工作记录列表
        int DECLARE_WORK = 1; //申报工作
        int PERIOD_WORK = 2; //周期性工作
        int CONSTANT_WORK = 3; //固定工作
    }

    public interface WorkLogType {
        int DAILY = 0; //日常工作
        int SCHEDULE = 1; //待办事项里的
        int COMMIT_LIST = 2; //评论列表点击进入的
    }

    public interface AddLogStatus {
        String EDITING = "0";
        String UN_SUBMIT = "1";
        String SUBMITTING = "2";
        String SUB_SUCCESS = "S";
        String SUB_FAIL = "E";

        String SUBMIT_EDITING = "SP"; //提交了但是又点了编辑,此状态不会自动提交
    }

    public interface UnreadStatus {
        String UNREAD = "0";
        String READ = "1";
    }

    public interface PersonOrOrg {
        String PERSON = "1";
        String ORG = "0";
    }

}
